--------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\wb614536\Downloads\replication\replication\code\../outputs/06_FirstStage_log.txt
  log type:  text
 opened on:  25 Jun 2026, 12:54:54
r; t=0.00 12:54:54

. 
. di "=================================================================="
==================================================================
r; t=0.00 12:54:54

. di "  06_FirstStage.do"
  06_FirstStage.do
r; t=0.00 12:54:54

. di "  Date: $S_DATE  Time: $S_TIME"
  Date: 25 Jun 2026  Time: 12:54:54
r; t=0.00 12:54:54

. di "=================================================================="
==================================================================
r; t=0.00 12:54:54

. 
. use "$clean/PEP_Analysis_Sample.dta", clear
(PEP analysis sample (JEEA-style + extended outcome indices))
r; t=0.12 12:54:54

. 
. /*==============================================================================
>   PART 1: APPLY JEEA-STYLE SAMPLE RESTRICTIONS
> ==============================================================================*/
. 
. local jeea_controls hhven_spouse hhven_other jobopp labven ///
>                     typeworkven1 typeworkven2 typeworkven3 ///
>                     written_cont average yrseduc healthmig frdfam ///
>                     smartven owner electven waterven sewageven female ///
>                     age_panel child_venez time_col
r; t=0.00 12:54:54

. 
. gen sample_roster = .
(13,580 missing values generated)
r; t=0.00 12:54:54

. qui reg trt_hh `jeea_controls'
r; t=2.36 12:54:57

. replace sample_roster = e(sample)
(13,580 real changes made)
r; t=0.00 12:54:57

. replace sample_roster = 0 if gasto_capita == . & trt_hh != .
(119 real changes made)
r; t=0.00 12:54:57

. replace sample_roster = 0 if employed == . & trt_hh != .
(88 real changes made)
r; t=0.00 12:54:57

. replace sample_roster = 0 if hora_semana == . & trt_hh != . & asalariado_num == 1
(64 real changes made)
r; t=0.00 12:54:57

. replace sample_roster = 0 if anx_depr == .
(2 real changes made)
r; t=0.00 12:54:57

. replace sample_roster = 0 if health_pca == .
(8 real changes made)
r; t=0.00 12:54:57

. bysort family_id: egen sample_reg = max(sample_roster)
r; t=0.02 12:54:57

. keep if (orden == 1 | orden == 2) & sample_reg == 1
(6,451 observations deleted)
r; t=0.02 12:54:57

. 
. di ""

r; t=0.00 12:54:57

. di "  JEEA analysis sample (orden in {1,2}, sample_reg==1):"
  JEEA analysis sample (orden in {1,2}, sample_reg==1):
r; t=0.00 12:54:57

. tab wave_num

       Survey wave |      Freq.     Percent        Cum.
-------------------+-----------------------------------
 Wave 1 (Baseline) |      4,328       60.71       60.71
Wave 2 (Follow-up) |      2,801       39.29      100.00
-------------------+-----------------------------------
             Total |      7,129      100.00
r; t=0.00 12:54:57

. 
. /*==============================================================================
>   PART 2: FIRST-STAGE ESTIMATES (sharp ITT) — INDIVIDUAL PEP
> ==============================================================================*/
. 
. di ""

r; t=0.00 12:54:57

. di "=================================================================="
==================================================================
r; t=0.00 12:54:57

. di "  First-stage estimates (sharp): rdrobust pep date | wave"
  First-stage estimates (sharp): rdrobust pep date | wave
r; t=0.00 12:54:57

. di "=================================================================="
==================================================================
r; t=0.00 12:54:57

. 
. local fs_pep_b_1   .
r; t=0.00 12:54:57

. local fs_pep_se_1  .
r; t=0.00 12:54:57

. local fs_pep_p_1   .
r; t=0.00 12:54:57

. local fs_pep_h_1   .
r; t=0.00 12:54:57

. local fs_pep_n_1   .
r; t=0.00 12:54:57

. local fs_pep_b_2   .
r; t=0.00 12:54:57

. local fs_pep_se_2  .
r; t=0.00 12:54:57

. local fs_pep_p_2   .
r; t=0.00 12:54:57

. local fs_pep_h_2   .
r; t=0.00 12:54:57

. local fs_pep_n_2   .
r; t=0.00 12:54:57

. 
. foreach w in 1 2 {
  2.     di ""
  3.     di "--- Wave `w' (treatment = pep, individual) ---"
  4.     capture rdrobust pep date if wave_num == `w', c(0)
  5.     if !_rc {
  6.         local fs_pep_b_`w'  = e(tau_cl)
  7.         local fs_pep_se_`w' = e(se_tau_cl)
  8.         local fs_pep_p_`w'  = e(pv_cl)
  9.         local fs_pep_h_`w'  = e(h_l)
 10.         local fs_pep_n_`w'  = e(N_h_l) + e(N_h_r)
 11.         di "  Jump = " %5.3f `fs_pep_b_`w'' "  SE = " %5.3f `fs_pep_se_`w'' ///
>            "  p = " %5.3f `fs_pep_p_`w'' "  bw = " %5.1f `fs_pep_h_`w'' ///
>            "  N(eff) = `fs_pep_n_`w''"
 12.     }
 13. }

--- Wave 1 (treatment = pep, individual) ---
  Jump = 0.413  SE = 0.058  p = 0.000  bw =  62.4  N(eff) = 830

--- Wave 2 (treatment = pep, individual) ---
  Jump = 0.456  SE = 0.072  p = 0.000  bw =  59.9  N(eff) = 499
r; t=0.51 12:54:57

. 
. /*==============================================================================
>   PART 3: FIRST-STAGE ESTIMATES — HH TREATMENT
> ==============================================================================*/
. 
. di ""

r; t=0.00 12:54:57

. di "=================================================================="
==================================================================
r; t=0.00 12:54:57

. di "  First-stage estimates (sharp): rdrobust trt_hh date | wave"
  First-stage estimates (sharp): rdrobust trt_hh date | wave
r; t=0.00 12:54:57

. di "=================================================================="
==================================================================
r; t=0.00 12:54:57

. 
. local fs_hh_b_1   .
r; t=0.00 12:54:57

. local fs_hh_se_1  .
r; t=0.00 12:54:57

. local fs_hh_p_1   .
r; t=0.00 12:54:57

. local fs_hh_h_1   .
r; t=0.00 12:54:57

. local fs_hh_n_1   .
r; t=0.00 12:54:57

. local fs_hh_b_2   .
r; t=0.00 12:54:57

. local fs_hh_se_2  .
r; t=0.00 12:54:57

. local fs_hh_p_2   .
r; t=0.00 12:54:57

. local fs_hh_h_2   .
r; t=0.00 12:54:57

. local fs_hh_n_2   .
r; t=0.00 12:54:57

. 
. foreach w in 1 2 {
  2.     di ""
  3.     di "--- Wave `w' (treatment = trt_hh, HH-level) ---"
  4.     capture rdrobust trt_hh date if wave_num == `w', c(0)
  5.     if !_rc {
  6.         local fs_hh_b_`w'  = e(tau_cl)
  7.         local fs_hh_se_`w' = e(se_tau_cl)
  8.         local fs_hh_p_`w'  = e(pv_cl)
  9.         local fs_hh_h_`w'  = e(h_l)
 10.         local fs_hh_n_`w'  = e(N_h_l) + e(N_h_r)
 11.         di "  Jump = " %5.3f `fs_hh_b_`w'' "  SE = " %5.3f `fs_hh_se_`w'' ///
>            "  p = " %5.3f `fs_hh_p_`w'' "  bw = " %5.1f `fs_hh_h_`w'' ///
>            "  N(eff) = `fs_hh_n_`w''"
 12.     }
 13. }

--- Wave 1 (treatment = trt_hh, HH-level) ---
  Jump = 0.431  SE = 0.057  p = 0.000  bw =  64.5  N(eff) = 936

--- Wave 2 (treatment = trt_hh, HH-level) ---
  Jump = 0.506  SE = 0.064  p = 0.000  bw =  66.6  N(eff) = 605
r; t=0.50 12:54:58

. 
. /*==============================================================================
>   PART 4: rdplot FIGURES — INDIVIDUAL PEP
> ==============================================================================*/
. 
. di ""

r; t=0.00 12:54:58

. di "--- Generating rdplot figures ---"
--- Generating rdplot figures ---
r; t=0.00 12:54:58

. 
. * Visualizations use `daterd` (= -date) so the x-axis reads naturally in
. * calendar time:
. *   - LEFT side (negative): arrived BEFORE the deadline = ELIGIBLE → high PEP
. *   - RIGHT side (positive): arrived AFTER the deadline = NOT eligible → low PEP
. * The rdrobust regressions above used `date` (reflected, JEEA convention) so
. * coefficients remain positive and comparable to the JEEA paper.
. 
. foreach w in 1 2 {
  2.     capture {
  3.         rdplot pep daterd if wave_num == `w' & abs(daterd) <= 206, c(0) p(1) ///
>             graph_options(title("Wave `w' first stage: Pr(PEP-RAMV) at deadline", size(medium)) ///
>                           ytitle("Pr(individual has PEP-RAMV)") ///
>                           xtitle("Days from June 8, 2018 deadline (negative = before, eligible)") ///
>                           note("Eligible side is the LEFT (negative).  Sample: orden in {1,2}, sample_reg==1.", si
> ze(vsmall)) ///
>                           name(fs_w`w', replace))
  4.         graph export "$figs/first_stage_w`w'.png", replace width(1000)
  5.         graph drop fs_w`w'
  6.     }
  7. }
r; t=3.74 12:55:02

. 
. * Combined figure: JEEA Figure 2B style — binned scatter + linear fit with
. * 95% CI bands, both waves overlaid in different colors.
. preserve
r; t=0.02 12:55:02

.     keep if abs(daterd) <= 206 & !missing(pep, daterd, wave_num)
(2,648 observations deleted)
r; t=0.01 12:55:02

. 
.     * Equally-spaced bins of width 20 days (similar to JEEA's binselect(qspr))
.     egen bin = cut(daterd), at(-210(20)210)
r; t=0.03 12:55:02

. 
.     * Within each (wave, bin), compute mean of pep and bin midpoint
.     bysort wave_num bin: egen pep_bin   = mean(pep)
r; t=0.03 12:55:02

.     bysort wave_num bin: egen bin_xmean = mean(daterd)
r; t=0.01 12:55:02

.     bysort wave_num bin: gen  first     = (_n == 1)
r; t=0.00 12:55:02

. 
.     twoway ///
>         (lfitci pep daterd if wave_num==1 & daterd<0,  lcolor(navy)      acolor(navy%18)      alpattern(solid)   l
> width(medthick)) ///
>         (lfitci pep daterd if wave_num==1 & daterd>=0, lcolor(navy)      acolor(navy%18)      alpattern(solid)   l
> width(medthick)) ///
>         (lfitci pep daterd if wave_num==2 & daterd<0,  lcolor(cranberry) acolor(cranberry%18) alpattern(longdash) 
> lwidth(medthick)) ///
>         (lfitci pep daterd if wave_num==2 & daterd>=0, lcolor(cranberry) acolor(cranberry%18) alpattern(longdash) 
> lwidth(medthick)) ///
>         (scatter pep_bin bin_xmean if wave_num==1 & first, msymbol(O) mcolor(navy)      mfcolor(white)     msize(m
> edlarge)) ///
>         (scatter pep_bin bin_xmean if wave_num==2 & first, msymbol(S) mcolor(cranberry) mfcolor(cranberry) msize(m
> edlarge)) ///
>         , xline(0, lcolor(black) lwidth(medthin)) ///
>           title("Discontinuity in Probability of Treatment, June 8, 2018", size(medsmall) color(black)) ///
>           ytitle("PEP-RAMV [=1]", size(small)) ///
>           xtitle("Arrival (days from June 8, 2018)", size(small)) ///
>           ylabel(0(0.25)1, nogrid notick labsize(small)) ///
>           xlabel(-200(50)200, nogrid notick labsize(small)) ///
>           legend(order(9 "Wave 1" 10 "Wave 2") rows(1) position(6) ///
>                  region(fcolor(white) lcolor(black) lwidth(thin)) size(small)) ///
>           graphregion(color(white) margin(small)) ///
>           plotregion(fcolor(white) lcolor(black) lwidth(thin) margin(small)) ///
>           bgcolor(white) ///
>           yscale(noline) xscale(noline) ///
>           note("Bins of 20 days. Linear fits on each side with 95% CI.", size(vsmall) color(black)) ///
>           name(fs_combined, replace)
r; t=3.59 12:55:05

.     graph export "$figs/first_stage_combined.png", replace width(1400)
(file ../outputs/figures_first_stage/first_stage_combined.png not found)
file ../outputs/figures_first_stage/first_stage_combined.png saved as PNG format
r; t=0.22 12:55:05

.     graph drop fs_combined
r; t=0.11 12:55:06

. restore
r; t=0.01 12:55:06

. 
. * HH-treatment first stage — same JEEA Figure 2B style
. preserve
r; t=0.03 12:55:06

.     keep if abs(daterd) <= 206 & !missing(trt_hh, daterd, wave_num)
(2,138 observations deleted)
r; t=0.01 12:55:06

.     egen bin = cut(daterd), at(-210(20)210)
r; t=0.02 12:55:06

.     bysort wave_num bin: egen trt_bin   = mean(trt_hh)
r; t=0.01 12:55:06

.     bysort wave_num bin: egen bin_xmean = mean(daterd)
r; t=0.00 12:55:06

.     bysort wave_num bin: gen  first     = (_n == 1)
r; t=0.00 12:55:06

. 
.     twoway ///
>         (lfitci trt_hh daterd if wave_num==1 & daterd<0,  lcolor(navy)      acolor(navy%18)      alpattern(solid) 
>   lwidth(medthick)) ///
>         (lfitci trt_hh daterd if wave_num==1 & daterd>=0, lcolor(navy)      acolor(navy%18)      alpattern(solid) 
>   lwidth(medthick)) ///
>         (lfitci trt_hh daterd if wave_num==2 & daterd<0,  lcolor(cranberry) acolor(cranberry%18) alpattern(longdas
> h) lwidth(medthick)) ///
>         (lfitci trt_hh daterd if wave_num==2 & daterd>=0, lcolor(cranberry) acolor(cranberry%18) alpattern(longdas
> h) lwidth(medthick)) ///
>         (scatter trt_bin bin_xmean if wave_num==1 & first, msymbol(O) mcolor(navy)      mfcolor(white)     msize(m
> edlarge)) ///
>         (scatter trt_bin bin_xmean if wave_num==2 & first, msymbol(S) mcolor(cranberry) mfcolor(cranberry) msize(m
> edlarge)) ///
>         , xline(0, lcolor(black) lwidth(medthin)) ///
>           title("First stage — HH treatment", size(medsmall) color(black)) ///
>           ytitle("HH has PEP-RAMV [=1]", size(small)) ///
>           xtitle("Arrival (days from June 8, 2018)", size(small)) ///
>           ylabel(0(0.25)1, nogrid notick labsize(small)) ///
>           xlabel(-200(50)200, nogrid notick labsize(small)) ///
>           legend(order(9 "Wave 1" 10 "Wave 2") rows(1) position(6) ///
>                  region(fcolor(white) lcolor(black) lwidth(thin)) size(small)) ///
>           graphregion(color(white) margin(small)) ///
>           plotregion(fcolor(white) lcolor(black) lwidth(thin) margin(small)) ///
>           bgcolor(white) ///
>           yscale(noline) xscale(noline) ///
>           note("Bins of 20 days. Linear fits on each side with 95% CI.", size(vsmall) color(black)) ///
>           name(fs_hh_combined, replace)
r; t=1.05 12:55:07

.     graph export "$figs/first_stage_hh_combined.png", replace width(1400)
(file ../outputs/figures_first_stage/first_stage_hh_combined.png not found)
file ../outputs/figures_first_stage/first_stage_hh_combined.png saved as PNG format
r; t=0.22 12:55:07

.     graph drop fs_hh_combined
r; t=0.11 12:55:07

. restore
r; t=0.01 12:55:07

. 
. di "  Figures saved to $figs/"
  Figures saved to ../outputs/figures_first_stage/
r; t=0.00 12:55:07

. 
. /*==============================================================================
>   PART 5: PDF REPORT
> ==============================================================================*/
. 
. di ""

r; t=0.00 12:55:07

. di "--- Building PDF report ---"
--- Building PDF report ---
r; t=0.00 12:55:07

. 
. putpdf clear
r; t=0.05 12:55:07

. putpdf begin, pagesize(letter) margin(left, 0.7in) margin(right, 0.7in)
r; t=0.03 12:55:07

. 
. putpdf paragraph, halign(center)
r; t=0.02 12:55:07

. putpdf text ("First-Stage Discontinuity"), bold font(, 16)
r; t=0.01 12:55:07

. putpdf paragraph, halign(center)
r; t=0.01 12:55:07

. putpdf text ("PEP-RAMV take-up at the RAMV closure cutoff (Wave 1 and Wave 2)"), italic
r; t=0.00 12:55:07

. putpdf paragraph, halign(center)
r; t=0.00 12:55:07

. putpdf text ("Generated $S_DATE."), italic font(, 10)
r; t=0.00 12:55:07

. 
. * First-stage table (individual pep)
. putpdf paragraph
r; t=0.00 12:55:07

. putpdf text ("1. First-stage estimates — individual treatment (pep)"), bold font(, 13)
r; t=0.00 12:55:07

. putpdf paragraph
r; t=0.03 12:55:07

. putpdf text ("rdrobust optimal bandwidth, sharp design."), italic font(, 10)
r; t=0.00 12:55:07

. 
. putpdf table fs1 = (3, 6), border(all)
r; t=0.02 12:55:07

. putpdf table fs1(1,1) = ("Wave"), bold halign(center)
r; t=0.01 12:55:07

. putpdf table fs1(1,2) = ("Jump"), bold halign(center)
r; t=0.00 12:55:07

. putpdf table fs1(1,3) = ("SE"), bold halign(center)
r; t=0.00 12:55:07

. putpdf table fs1(1,4) = ("p"), bold halign(center)
r; t=0.00 12:55:07

. putpdf table fs1(1,5) = ("BW (days)"), bold halign(center)
r; t=0.00 12:55:07

. putpdf table fs1(1,6) = ("N (eff.)"), bold halign(center)
r; t=0.00 12:55:07

. putpdf table fs1(2,1) = ("Wave 1")
r; t=0.00 12:55:07

. putpdf table fs1(2,2) = ("`=string(`fs_pep_b_1', "%5.3f")'")
r; t=0.00 12:55:07

. putpdf table fs1(2,3) = ("`=string(`fs_pep_se_1', "%5.3f")'")
r; t=0.00 12:55:07

. putpdf table fs1(2,4) = ("`=string(`fs_pep_p_1', "%5.3f")'")
r; t=0.00 12:55:07

. putpdf table fs1(2,5) = ("`=string(`fs_pep_h_1', "%4.1f")'")
r; t=0.00 12:55:07

. putpdf table fs1(2,6) = ("`fs_pep_n_1'")
r; t=0.00 12:55:07

. putpdf table fs1(3,1) = ("Wave 2")
r; t=0.00 12:55:07

. putpdf table fs1(3,2) = ("`=string(`fs_pep_b_2', "%5.3f")'")
r; t=0.00 12:55:07

. putpdf table fs1(3,3) = ("`=string(`fs_pep_se_2', "%5.3f")'")
r; t=0.00 12:55:07

. putpdf table fs1(3,4) = ("`=string(`fs_pep_p_2', "%5.3f")'")
r; t=0.00 12:55:07

. putpdf table fs1(3,5) = ("`=string(`fs_pep_h_2', "%4.1f")'")
r; t=0.00 12:55:07

. putpdf table fs1(3,6) = ("`fs_pep_n_2'")
r; t=0.00 12:55:07

. 
. * First-stage table (HH)
. putpdf paragraph
r; t=0.01 12:55:07

. putpdf text ("2. First-stage estimates — HH treatment (trt_hh)"), bold font(, 13)
r; t=0.00 12:55:07

. 
. putpdf table fs2 = (3, 6), border(all)
r; t=0.00 12:55:07

. putpdf table fs2(1,1) = ("Wave"), bold halign(center)
r; t=0.00 12:55:07

. putpdf table fs2(1,2) = ("Jump"), bold halign(center)
r; t=0.00 12:55:07

. putpdf table fs2(1,3) = ("SE"), bold halign(center)
r; t=0.00 12:55:07

. putpdf table fs2(1,4) = ("p"), bold halign(center)
r; t=0.00 12:55:07

. putpdf table fs2(1,5) = ("BW (days)"), bold halign(center)
r; t=0.00 12:55:07

. putpdf table fs2(1,6) = ("N (eff.)"), bold halign(center)
r; t=0.00 12:55:07

. putpdf table fs2(2,1) = ("Wave 1")
r; t=0.00 12:55:07

. putpdf table fs2(2,2) = ("`=string(`fs_hh_b_1', "%5.3f")'")
r; t=0.00 12:55:07

. putpdf table fs2(2,3) = ("`=string(`fs_hh_se_1', "%5.3f")'")
r; t=0.00 12:55:07

. putpdf table fs2(2,4) = ("`=string(`fs_hh_p_1', "%5.3f")'")
r; t=0.00 12:55:07

. putpdf table fs2(2,5) = ("`=string(`fs_hh_h_1', "%4.1f")'")
r; t=0.00 12:55:07

. putpdf table fs2(2,6) = ("`fs_hh_n_1'")
r; t=0.00 12:55:07

. putpdf table fs2(3,1) = ("Wave 2")
r; t=0.00 12:55:07

. putpdf table fs2(3,2) = ("`=string(`fs_hh_b_2', "%5.3f")'")
r; t=0.00 12:55:07

. putpdf table fs2(3,3) = ("`=string(`fs_hh_se_2', "%5.3f")'")
r; t=0.00 12:55:07

. putpdf table fs2(3,4) = ("`=string(`fs_hh_p_2', "%5.3f")'")
r; t=0.00 12:55:07

. putpdf table fs2(3,5) = ("`=string(`fs_hh_h_2', "%4.1f")'")
r; t=0.00 12:55:07

. putpdf table fs2(3,6) = ("`fs_hh_n_2'")
r; t=0.00 12:55:07

. 
. * Wave 1 figure
. putpdf paragraph
r; t=0.00 12:55:07

. putpdf text ("3. Visual: Wave 1 first stage (individual PEP)"), bold font(, 13)
r; t=0.00 12:55:07

. capture confirm file "$figs/first_stage_w1.png"
r; t=0.00 12:55:07

. if !_rc {
.     putpdf paragraph, halign(center)
r; t=0.00 12:55:07
.     putpdf image "$figs/first_stage_w1.png", width(5.5)
r; t=0.01 12:55:07
. }
r; t=0.01 12:55:07

. 
. * Wave 2 figure
. putpdf paragraph
r; t=0.01 12:55:07

. putpdf text ("4. Visual: Wave 2 first stage (individual PEP)"), bold font(, 13)
r; t=0.00 12:55:07

. capture confirm file "$figs/first_stage_w2.png"
r; t=0.00 12:55:07

. if !_rc {
.     putpdf paragraph, halign(center)
r; t=0.00 12:55:07
.     putpdf image "$figs/first_stage_w2.png", width(5.5)
r; t=0.00 12:55:07
. }
r; t=0.00 12:55:07

. 
. putpdf save "$out/06_FirstStage_part1.pdf", replace
successfully created "C:/Users/wb614536/Downloads/replication/replication/outputs/06_FirstStage_part1.pdf"
r; t=0.06 12:55:07

. 
. * Part 2: combined figures (separate PDF to avoid putpdf state issues)
. putpdf clear
r; t=0.00 12:55:07

. putpdf begin, pagesize(letter) margin(left, 0.7in) margin(right, 0.7in)
r; t=0.00 12:55:07

. putpdf paragraph, halign(center)
r; t=0.00 12:55:07

. putpdf text ("First-Stage Discontinuity — Part 2: combined views"), bold font(, 14)
r; t=0.00 12:55:07

. 
. putpdf paragraph
r; t=0.03 12:55:07

. putpdf text ("5. Combined: both waves on same axes (individual pep)"), bold font(, 13)
r; t=0.00 12:55:07

. capture confirm file "$figs/first_stage_combined.png"
r; t=0.00 12:55:07

. if !_rc {
.     putpdf paragraph, halign(center)
r; t=0.00 12:55:07
.     putpdf image "$figs/first_stage_combined.png", width(6)
r; t=0.00 12:55:07
. }
r; t=0.00 12:55:07

. 
. putpdf paragraph
r; t=0.01 12:55:07

. putpdf text ("6. Combined: HH treatment (trt_hh) by wave"), bold font(, 13)
r; t=0.00 12:55:07

. capture confirm file "$figs/first_stage_hh_combined.png"
r; t=0.00 12:55:07

. if !_rc {
.     putpdf paragraph, halign(center)
r; t=0.00 12:55:07
.     putpdf image "$figs/first_stage_hh_combined.png", width(6)
r; t=0.00 12:55:07
. }
r; t=0.00 12:55:07

. 
. putpdf save "$out/06_FirstStage_part2.pdf", replace
successfully created "C:/Users/wb614536/Downloads/replication/replication/outputs/06_FirstStage_part2.pdf"
r; t=0.07 12:55:07

. 
. copy "$out/06_FirstStage_part1.pdf" "$out/06_FirstStage.pdf", replace
(file ../outputs/06_FirstStage.pdf not found)
r; t=0.01 12:55:07

. 
. * LaTeX skeleton
. file open tex using "$out/06_FirstStage.tex", write replace
(file ../outputs/06_FirstStage.tex not found)
r; t=0.00 12:55:07

. file write tex "\documentclass[11pt]{article}\usepackage[margin=1in]{geometry}\usepackage{booktabs,graphicx}" _n
r; t=0.00 12:55:07

. file write tex "\title{First-Stage Discontinuity}\author{Sandra Rozo}\date{\today}\begin{document}\maketitle" _n
r; t=0.00 12:55:07

. file write tex "\section*{Individual treatment (pep)}" _n
r; t=0.00 12:55:07

. file write tex "\begin{tabular}{lrrrrr}\toprule" _n
r; t=0.00 12:55:07

. file write tex "Wave & Jump & SE & p & BW & N \\\midrule" _n
r; t=0.00 12:55:07

. file write tex "W1 & " %5.3f (`fs_pep_b_1') " & " %5.3f (`fs_pep_se_1') " & " %5.3f (`fs_pep_p_1') " & " %4.1f (`f
> s_pep_h_1') " & `fs_pep_n_1' \\" _n
r; t=0.00 12:55:07

. file write tex "W2 & " %5.3f (`fs_pep_b_2') " & " %5.3f (`fs_pep_se_2') " & " %5.3f (`fs_pep_p_2') " & " %4.1f (`f
> s_pep_h_2') " & `fs_pep_n_2' \\\bottomrule\end{tabular}" _n
r; t=0.00 12:55:07

. file write tex "\section*{HH treatment (trt\_hh)}" _n
r; t=0.00 12:55:07

. file write tex "\begin{tabular}{lrrrrr}\toprule" _n
r; t=0.00 12:55:07

. file write tex "Wave & Jump & SE & p & BW & N \\\midrule" _n
r; t=0.00 12:55:07

. file write tex "W1 & " %5.3f (`fs_hh_b_1') " & " %5.3f (`fs_hh_se_1') " & " %5.3f (`fs_hh_p_1') " & " %4.1f (`fs_h
> h_h_1') " & `fs_hh_n_1' \\" _n
r; t=0.00 12:55:07

. file write tex "W2 & " %5.3f (`fs_hh_b_2') " & " %5.3f (`fs_hh_se_2') " & " %5.3f (`fs_hh_p_2') " & " %4.1f (`fs_h
> h_h_2') " & `fs_hh_n_2' \\\bottomrule\end{tabular}" _n
r; t=0.00 12:55:07

. file write tex "\end{document}" _n
r; t=0.00 12:55:07

. file close tex
r; t=0.00 12:55:07

. 
. di ""

r; t=0.00 12:55:07

. di "  PDF saved:    $out/06_FirstStage.pdf"
  PDF saved:    ../outputs/06_FirstStage.pdf
r; t=0.00 12:55:07

. di "                $out/06_FirstStage_part2.pdf"
                ../outputs/06_FirstStage_part2.pdf
r; t=0.00 12:55:07

. di "  TeX saved:    $out/06_FirstStage.tex"
  TeX saved:    ../outputs/06_FirstStage.tex
r; t=0.00 12:55:07

. di "  Figures:      $figs/"
  Figures:      ../outputs/figures_first_stage/
r; t=0.00 12:55:08

. di "  Done."
  Done.
r; t=0.00 12:55:08

. 
. log close
      name:  <unnamed>
       log:  C:\Users\wb614536\Downloads\replication\replication\code\../outputs/06_FirstStage_log.txt
  log type:  text
 closed on:  25 Jun 2026, 12:55:08
--------------------------------------------------------------------------------------------------------------------
